inherited frmRelVendasDocumento: TfrmRelVendasDocumento
  Left = 352
  Top = 373
  Caption = 'Vendas por Documento'
  ClientHeight = 178
  ClientWidth = 444
  OldCreateOrder = True
  PixelsPerInch = 96
  TextHeight = 13
  inherited pnlOpcoes: TPanel
    Width = 444
    Height = 93
    object Label1: TLabel
      Left = 8
      Top = 8
      Width = 41
      Height = 13
      Caption = 'Empresa'
    end
    object Label3: TLabel
      Left = 8
      Top = 48
      Width = 38
      Height = 13
      Caption = 'Per'#237'odo'
    end
    object Label8: TLabel
      Left = 80
      Top = 72
      Width = 6
      Height = 13
      Caption = 'a'
    end
    object Label4: TLabel
      Left = 192
      Top = 48
      Width = 46
      Height = 13
      Caption = 'Vendedor'
    end
    object Label10: TLabel
      Left = 384
      Top = 8
      Width = 44
      Height = 13
      Caption = 'Tipo Doc'
    end
    object stEmpresa: TStaticText
      Left = 85
      Top = 24
      Width = 292
      Height = 21
      AutoSize = False
      BorderStyle = sbsSingle
      TabOrder = 0
    end
    object BtnEmpresa: TBitBtn
      Left = 64
      Top = 24
      Width = 21
      Height = 21
      Hint = 'Buscar'
      Caption = '...'
      ParentShowHint = False
      ShowHint = True
      TabOrder = 1
      TabStop = False
      OnClick = BtnEmpresaClick
    end
    object edtEmpresa: TEdit
      Left = 8
      Top = 24
      Width = 57
      Height = 21
      Hint = 'C'#243'digo da empresa'
      ParentShowHint = False
      ShowHint = True
      TabOrder = 2
      OnExit = edtEmpresaExit
    end
    object EdtDataInicial: TEdit
      Left = 8
      Top = 64
      Width = 65
      Height = 21
      Hint = 'Data inicial'
      ParentShowHint = False
      ShowHint = True
      TabOrder = 3
      OnExit = EdtDataInicialExit
    end
    object EdtDataFinal: TEdit
      Left = 96
      Top = 64
      Width = 81
      Height = 21
      Hint = 'Data final'
      ParentShowHint = False
      ShowHint = True
      TabOrder = 4
      OnExit = EdtDataInicialExit
    end
    object EdtVendedorCod: TEdit
      Left = 192
      Top = 64
      Width = 49
      Height = 21
      Hint = 'C'#243'digo do vendedor'
      ParentShowHint = False
      ShowHint = True
      TabOrder = 5
      OnExit = EdtVendedorCodExit
    end
    object BtnVendedor: TBitBtn
      Left = 240
      Top = 64
      Width = 21
      Height = 21
      Hint = 'Buscar'
      Caption = '...'
      ParentShowHint = False
      ShowHint = True
      TabOrder = 6
      TabStop = False
      OnClick = BtnVendedorClick
    end
    object EdtVendedorNome: TStaticText
      Left = 261
      Top = 64
      Width = 172
      Height = 21
      AutoSize = False
      BorderStyle = sbsSingle
      TabOrder = 7
    end
    object cbTipo: TComboBox
      Left = 384
      Top = 24
      Width = 49
      Height = 21
      AutoDropDown = True
      CharCase = ecUpperCase
      ItemHeight = 13
      MaxLength = 1
      TabOrder = 8
      Items.Strings = (
        'L'
        'U'
        'T')
    end
  end
  inherited pnlBotoes: TPanel
    Top = 134
    Width = 444
  end
  inherited pnlCabecalho: TPanel
    Width = 444
    Caption = 'Vendas por Documento'
  end
  inherited sql_dataset_principal: TSQLClientDataSet
    CommandText = 
      'select'#13#10'  sad_idfdoc,'#13#10'  sad_docume,'#13#10'  sad_datave,'#13#10'  sad_orcam' +
      'e,'#13#10'  sad_cancelado,'#13#10'  usu_codigo,'#13#10'  usu_nome,'#13#10'  pes_nome,'#13#10' ' +
      ' sum(sai_quanti) qtde,'#13#10'  sum(sai_preven*sai_quanti) valor'#13#10'from' +
      ' saida_documento'#13#10'inner join saida_item on sai_idfdoc=sad_idfdoc' +
      #13#10'inner join usuarios on usu_codigo=sad_codven'#13#10'inner join pesso' +
      'as on pes_idfcod=sad_codcli'#13#10'group by sad_idfdoc,sad_docume,sad_' +
      'datave,sad_orcame,sad_cancelado,usu_codigo,usu_nome,pes_nome'
    Left = 136
    Top = 9
    object sql_dataset_principalSAD_IDFDOC: TIntegerField
      FieldName = 'SAD_IDFDOC'
      Required = True
    end
    object sql_dataset_principalSAD_DOCUME: TStringField
      FieldName = 'SAD_DOCUME'
      Required = True
      Size = 13
    end
    object sql_dataset_principalSAD_DATAVE: TDateField
      FieldName = 'SAD_DATAVE'
      Required = True
    end
    object sql_dataset_principalSAD_ORCAME: TStringField
      FieldName = 'SAD_ORCAME'
      Size = 13
    end
    object sql_dataset_principalUSU_CODIGO: TStringField
      FieldName = 'USU_CODIGO'
      Required = True
      Size = 3
    end
    object sql_dataset_principalUSU_NOME: TStringField
      FieldName = 'USU_NOME'
      Required = True
      Size = 60
    end
    object sql_dataset_principalPES_NOME: TStringField
      FieldName = 'PES_NOME'
      Required = True
      Size = 60
    end
    object sql_dataset_principalQTDE: TFMTBCDField
      FieldName = 'QTDE'
      Precision = 15
      Size = 3
    end
    object sql_dataset_principalVALOR: TFMTBCDField
      FieldName = 'VALOR'
      Precision = 15
      Size = 7
    end
    object sql_dataset_principalSAD_CANCELADO: TStringField
      FieldName = 'SAD_CANCELADO'
      Required = True
      FixedChar = True
      Size = 1
    end
  end
  inherited rds_dataset_principal: TRvDataSetConnection
    Left = 104
    Top = 9
  end
  inherited RvRenderPDF1: TRvRenderPDF
    Left = 400
  end
  inherited RvSystemPDF: TRvSystem
    Left = 72
    Top = 9
  end
  object rdVendasDocumento: TRvDataSetConnection
    RuntimeVisibility = rtDeveloper
    DataSet = sql_dataset_principal
    Left = 168
    Top = 8
  end
  object SQLC_Pagamento: TSQLClientDataSet
    Active = True
    CommandText = 
      'select'#13#10'  fpg_codigo,'#13#10'  fpg_nome,'#13#10'  sum(saf_valor) valor_forma' +
      #13#10'from saida_forma'#13#10'inner join formaspagamento on fpg_codigo=saf' +
      '_codforma'#13#10'group by fpg_codigo,fpg_nome'
    Aggregates = <>
    Options = [poAllowCommandText]
    ObjectView = True
    Params = <>
    DBConnection = DtmGeral.ConexaoBanco
    Left = 304
    Top = 9
    object SQLC_PagamentoFPG_CODIGO: TSmallintField
      FieldName = 'FPG_CODIGO'
      Required = True
    end
    object SQLC_PagamentoFPG_NOME: TStringField
      FieldName = 'FPG_NOME'
      Required = True
      Size = 40
    end
    object SQLC_PagamentoVALOR_FORMA: TFMTBCDField
      FieldName = 'VALOR_FORMA'
      Precision = 15
      Size = 8
    end
  end
  object rvPagamento: TRvDataSetConnection
    RuntimeVisibility = rtDeveloper
    DataSet = SQLC_Pagamento
    Left = 336
    Top = 9
  end
  object SQLC_Totais: TSQLClientDataSet
    Active = True
    CommandText = 
      'select'#13#10'  sum(sai_quanti) qtdtotal,'#13#10'  sum(sai_preven*sai_quanti' +
      ') valtotal,'#13#10'  sum(case when (sad_cancelado='#39'S'#39') then sai_quanti' +
      ' end) qtdcancel,'#13#10'  sum(case when (sad_cancelado='#39'S'#39') then (sai_' +
      'preven*sai_quanti) end) valcancel'#13#10'from saida_documento'#13#10'inner j' +
      'oin saida_item on sai_idfdoc=sad_idfdoc'
    Aggregates = <>
    Options = [poAllowCommandText]
    ObjectView = True
    Params = <>
    DBConnection = DtmGeral.ConexaoBanco
    Left = 240
    Top = 9
    object SQLC_TotaisQTDTOTAL: TFMTBCDField
      FieldName = 'QTDTOTAL'
      Precision = 15
      Size = 3
    end
    object SQLC_TotaisVALTOTAL: TFMTBCDField
      FieldName = 'VALTOTAL'
      Precision = 15
      Size = 7
    end
    object SQLC_TotaisQTDCANCEL: TFMTBCDField
      FieldName = 'QTDCANCEL'
      Precision = 15
      Size = 3
    end
    object SQLC_TotaisVALCANCEL: TFMTBCDField
      FieldName = 'VALCANCEL'
      Precision = 15
      Size = 7
    end
  end
  object rvTotais: TRvDataSetConnection
    RuntimeVisibility = rtDeveloper
    DataSet = SQLC_Totais
    Left = 272
    Top = 9
  end
end
